"use strict";
//Cordova监听
/*onDeviceReady();
function onDeviceReady() {
    document.addEventListener("deviceready", myDeviceReady, false);
}
//Cordova加载完毕
function myDeviceReady(){
    console.log('Device is Ready!');
}*/
function receiveJavaPostMessage(name, data) {
    let object = JSON.parse(data.replace(/([^\w])(\d+):/g, '$1\"$2\":'));//tt对讲中传过来key值为数字转化为字符串
    window.postMessage({
        type: 'intercom',
        name: name,
        data: object
    }, '*');
}


/*
function initialize(){
	console.log("sss");
	document.addEventListener("deviceready",onDeviceReady,false);
}

// Android only: check permission
function hasReadPermission() {
	window.plugins.sim.hasReadPermission(successCallback, errorCallback);
}

// Android only: request permission
function requestReadPermission() {
	window.plugins.sim.requestReadPermission(successCallback, errorCallback);
}

*/
//监听返回键按钮事件